<?php
/**
 * @author spenceryg
 * @date 2023/3/28
 * @time 9:12 下午
 * @focus love & life
 */


namespace app\admin\validate;


class UploadValidate extends \think\Validate
{

    private $fileExt = null;
    private $fileSize = null;

    public function __construct()
    {
        $this->fileExt =  config('memberfile.file_extension');
        $this->fileSize = config('memberfile.file_size') * 1024 * 1024;
    }



    public $rule = [
        'file' => [
            'fileExt' =>  $this->fileExt,
            'fileSize' =>   $this->fileSize
        ],
    ];
    protected $message = [
        'file.fileExt' => '当前文件后缀名不可上传',
        'file.fileSize' => '文件大小超出限制',
    ];
}
